#include<iostream>
using namespace std;

class Solution
{
public:
    bool CheckPermutation(string s1, string s2)
    {
        int len1 = s1.size(), len2 = s2.size();
        if (len1 != len2)
        {
            return false;
        }
        int ValueArr[26] = { 0 };
        for (int i = 0; i < len1; i++)
        {
            ValueArr[s1[i] - 'a']++;
            ValueArr[s2[i] - 'a']--;
        }
        for (int i = 0; i < 26; i++)
        {
            if (ValueArr[i] != 0)
            {
                return false;
            }
        }
        return true;
    }
};

int main()
{
    string str1("abcdef");
    string str2("crafeb");
    Solution s;
    if (s.CheckPermutation(str1, str2))
    {
        cout << "true" << endl;
    }
    else
    {
        cout << "false" << endl;
    }
    return 0;
}

